@import './layui-uieditor.base.less';
@import './drag-uieditor.less';
@import '../lay/modules/selectInput-uieditor.less';

@editorLeftWidth : 200px;
@editorRightWidth: 300px;

.vue-uieditor {
  height: 100%;
  width: 100%;
  position: relative;

  .editor-json-content {
    position: absolute;
    z-index: 100;
    top: 40px;
    left: 200px;

    padding: 0;
    overflow: hidden auto;

    >.editor-json-focus {
      position: fixed;
      top: 0;
      left: 0;
      overflow: hidden;
      width: 0;
      height: 0;
      padding: 0;
      margin: 0;
      border: 0;

      &:focus {
        outline: none;
      }
    }
  }

  .editor-priview-content {
    position: absolute;
    z-index: 100;
    padding: 4px;
    top: 40px;
    overflow: hidden auto;
  }

  .compiler-error {
    margin: 10px 20px;
    color: red;
  }


  & ::-webkit-scrollbar-thumb {
    background-color: rgba(50, 50, 50, .13)
  }

  & ::-webkit-scrollbar-thumb:hover {
    background-color: rgba(50, 50, 50, .26)
  }

  & ::-webkit-scrollbar-track {
    background-color: rgba(50, 50, 50, .1)
  }

  & ::-webkit-scrollbar-track:hover {
    background-color: rgba(50, 50, 50, .2)
  }

  & ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
  }

}

.layui-uieditor {
  height: 100%;
  width: 100%;
  position: relative;

  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  line-height: 24px;
  font: 14px Helvetica Neue, Helvetica, PingFang SC, Tahoma, Arial, sans-serif;

  .layui-disabled {
    pointer-events: none;
    cursor: not-allowed !important;
    color: #d2d2d2 !important;
  }

  // *,:after,:before {
  //   box-sizing: border-box
  // }

  >.layui-tab {
    height: 100%;
    width: 100%;
    position: relative;

    >.layui-tab-title {
      position: absolute;
      width: 100%;
      top: 0;
      left: 0;
      z-index: 1;

      >.layui-tab-first {
        margin-left: 20px; // calc(@editorLeftWidth + 5px);
      }

      >.layui-this {
        background-color: transparent;
        color: #1E9FFF;

        &:after {
          border-width: 0 0 2px 0;
          border-style: solid;
          border-bottom-color: #1886e6;
        }
      }

      >li {
        min-width: 50px;
        padding: 0 5px;
        font-size: 13px;
      }
    }

    >.layui-tab-content {
      position: absolute;
      // top: 0;
      top: 42px;
      bottom: 0;
      left: 0;
      z-index: 3;
      box-sizing: border-box;
      width: 100%;
      // height: 100%;
      padding: 0 !important;

      >.layui-tab-item {
        height: 100%;
        background-color: white;

        >.layui-tab-codeeditor {
          position: absolute;
          top: -1px;
          width: 100%;
          bottom: 10px;
        }
      }
    }
  }

  .editor-priview-content-in {
    height: 100%;
    width: 100%;
    position: relative;
    overflow: hidden auto;
  }

  //面版
  .editor-pane {
    height: 100%;
    width: 100%;
    overflow: hidden;
    position: relative;

    .layui-colla-content {
      font-size: 12px;
      padding: 6px;
    }

    //左
    >.left {
      position: absolute;
      top: 0;
      left: 0;
      overflow: hidden;
      width: @editorLeftWidth;
      height: 100%;
      z-index: 1;
      border-right: solid 1px #e6e6e6;

      >.left-content {
        overflow: hidden auto;
        width: 100%;
        height: 100%;
        position: relative;
      }

    }

    //中
    >.center {
      position: absolute;
      top: 0;
      left: 0;
      z-index: 0;
      overflow: hidden;
      padding-left: @editorLeftWidth;
      padding-right: @editorRightWidth;
      box-sizing: border-box;
      height: 100%;
      width: 100%;

      >.center-content {
        overflow: hidden;
        width: 100%;
        height: 100%;
        position: relative;
      }

      .editor-content {
        position: relative;
        overflow: hidden;
        width: 100%;
        height: 100%;


        >.editor-json-content-in {
          position: absolute;
          box-sizing: border-box;
          height: 100%;
          width: 100%;
          bottom: 0;
          left: 0;
          padding: 34px 0 0 0;
          overflow: hidden;

          >div {
            height: 100%;
            width: 100%;
          }

        }


        >.center-breadcrumb {
          color: #999;
          font-size: 12px;
          height: 34px;
          line-height: 34px;
          padding-left: 5px;
          border-bottom: 1px solid #e6e6e6;
          position: absolute;
          box-sizing: border-box;
          top: 0;
          left: 0;
          width: 100%;
          background-color: white;
          z-index: 9991;

          .center-breadcrumb-item {
            color: #515a6e;
            transition: color .2s ease-in-out;

            &.link {
              font-weight: bold;
              cursor: pointer;
            }
          }

          .center-breadcrumb-item-separator {
            margin: 0;
            color: #dcdee2;
          }

        }

      }
    }

    //右
    >.right {
      position: absolute;
      top: 0;
      right: 0;
      z-index: 1;
      overflow: hidden;
      width: @editorRightWidth;
      height: 100%;
      border-left: solid 1px #e6e6e6;

      >.right-content {
        overflow: hidden auto;
        width: 100%;
        height: 100%;
        position: relative;
      }
    }

  }


  .tool-bar {
    position: absolute;
    z-index: 2;
    top: 5px;
    right: 12px;

    .layui-btn-group {
      // border: none;

      .layui-btn {
        border: none !important;
        background-color: transparent;
      }

      .divided {
        border-left: 1px solid #c9c9c9 !important;
      }
    }
  }

  //面版tab, 用于左右工具栏的tab
  .editor-pane-tab {
    margin: 4px 0 10px 0;

    >.layui-tab-title {
      height: 30px;

      >li {
        font-size: 12px;
        line-height: 30px;
        min-width: auto;
        padding: 0 12px;
      }

      >.layui-this {
        color: #1E9FFF;

        &:after {
          height: 31px;
        }
      }

      >.layui-tab-bar {
        width: 16px;
        height: 27px;
        line-height: 27px;

        >i {
          font-size: 12px;
        }
      }
    }

    >.layui-tab-content {
      padding: 0;
    }
  }

  // 用于editor-pane-tab里面
  .editor-pane-collapse {
    border: 0;

    .layui-colla-title {
      font-size: 12px;
      height: 30px;
      line-height: 30px;
      background-color: #f5f5f5;
    }

    .editor-pane-collapse-title {
      font-weight: bold;
    }

  }

  .uieditor-searchform {
    font-size: 12px;
    position: relative;
    height: 34px;

    >input {
      height: 34px;
      border-top: 0;
      border-left: 0;
      border-right: 0;
      box-sizing: border-box;
      position: absolute;
      padding-right: 28px;
    }

    >i {
      position: absolute;
      right: 4px;
      top: 8px;
      color: #c2c2c2;
      cursor: pointer;
    }
  }

  // 用于editor-pane-tab里面
  .uieditor-form {
    overflow: hidden;

    button {
      font-size: 12px;
    }

    .uieditor-add-item {
      overflow: hidden;

      >.layui-form-label {
        color: #1E9FFF;
      }

      input {
        padding-right: 50px;
        position: absolute;
        border-color: #1E9FFF;

        &:hover,
        &:focus {
          border-color: #1E9FFF !important;

        }
      }

      .layui-btn-group {
        position: absolute;
        right: 0;
      }
    }

    .layui-form-item {
      margin-bottom: 2px;

      .layui-form-select dl {
        top: 32px;
        padding: 5px 0;
        z-index: 899;
        min-width: 100%;
        border: 1px solid #d2d2d2;
        max-height: 300px;
        overflow-y: auto;
        background-color: #fff;
        border-radius: 2px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, .12);
        box-sizing: border-box;
      }

      .layui-form-selectup dl {
        top: auto;
        bottom: 32px;

        dd {
          padding: 0 10px;
          line-height: 30px;
          white-space: nowrap;
          overflow: hidden;
          text-overflow: ellipsis;
        }
      }


      .layui-form-label {
        float: none;
        padding: 2px;
        width: auto;
        font-weight: 400;
        line-height: 20px;
        text-align: left;
        font-size: 12px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;

        >i {
          font-size: 12px;
          margin-right: 2px;
          cursor: pointer;
        }
      }

      .layui-form-mid {
        position: relative;
        float: none;
        display: block;
        padding: 2px 0 !important;
        line-height: 20px;
        margin-right: 0;
        font-size: 12px;
      }


      .layui-input-block {
        margin-left: 0;
        min-height: 30px;

        div[ue-slider] {
          padding: 13px 14px;
        }

        div[colorpicker] {
          height: 30px;
          position: relative;

          >input {
            position: absolute;
            z-index: 0;
            box-sizing: border-box;
            top: 0;
            left: 0;
            padding-right: 30px;
          }

          >div {
            position: absolute;
            z-index: 0;
            box-sizing: border-box;
            top: 0;
            right: 0;
            margin: 0;

            >div {
              padding: 1px;
            }
          }
        }

        &.attr-bind {
          >.layui-badge {
            position: absolute;
            z-index: 1;
            top: 0;
            left: 0;
            padding: 0;
            height: 100%;
            padding-top: 5px;
            cursor: pointer;
            box-sizing: border-box;
            min-width: 12px;

            &.layui-bg-gray {
              cursor: default;
              background-color: #d6d6d6 !important;
            }

            &.layui-bg-blue {
              background-color: #c8e3f7 !important;
            }

            &.layui-bg-blue:hover {
              background-color: #83c7fb !important;
            }

            &.layui-bg-blue-active {
              background-color: #1E9FFF !important;
            }

            &.layui-bg-blue-active:hover {
              background-color: #5cb4f7 !important;
            }

            &.layui-bg-orange {
              cursor: default;
            }

          }

          input {
            position: absolute;
            padding-left: 18px;
            z-index: 0;
          }

          .layui-form-selected .layui-edge {
            margin-top: 6px;
          }

          .layui-edge {
            margin-top: 12px;
          }

        }

        &.attr-code {

          input {
            position: absolute;
            padding-right: 22px;
            z-index: 0;
          }

          >i {
            position: absolute;
            z-index: 1;
            right: 3px;
            top: 0;
            font-size: 20px;
            color: #c2c2c2;
            cursor: pointer;

            &:hover {
              color: #686868;
            }
          }
        }

        button {
          height: 30px;
          line-height: 30px;
          padding: 0px 10px;
        }

        .layui-form-radio {
          margin: 1px 2px 0 0;
          padding-right: 2px;

          >i {
            margin-right: 4px;
            font-size: 18px;
          }
        }

        .layui-form-switch {
          height: 20px;
          line-height: 20px;
          min-width: 32px;
          padding: 0 5px;
          margin-top: 2px;
          border-radius: 10px;

          &.layui-form-onswitch {
            >em {
              left: 0 !important;
              margin-left: 2px;
              margin-right: 18px;
            }

            >i {
              left: 100%;
              margin-left: -20px;
            }
          }

          >em {
            left: 14px;
            margin-left: 2px;
            margin-right: 18px;
          }

          >i {
            width: 14px;
            height: 14px;
          }
        }

        .layui-form-checkbox {
          height: 26px;
          line-height: 26px;
          margin-right: 2px;
          padding-right: 26px;

          &.layui-form-checked {
            >.i {
              color: #5FB878;
            }
          }

          >span {
            padding: 0 10px;
            font-size: 12px;
            border-radius: 2px 0 0 2px;
          }

          >i {
            right: 1px;
            top: 0;
            width: 24px;
            height: 24px;
            border-radius: 0 2px 2px 0;
            font-size: 20px;
          }

          &[lay-skin="primary"] {
            margin-top: 5px;
            padding-left: 24px;
            padding-right: 0;

            >span {
              padding-left: 0;
              padding-right: 5px;
              line-height: 18px;
              background: none;
              color: #666;
            }

            >i {
              left: 0;
              width: 16px;
              height: 16px;
              line-height: 16px;
              border: 1px solid #d2d2d2;
              font-size: 12px;
              border-radius: 2px;
            }
          }

        }

        .layui-input,
        .layui-textarea,
        .layui-select {
          height: 30px;
          line-height: 1.3;
          font-size: 12px;
          border-width: 1px;
          border-style: solid;
          background-color: #fff;
          border-radius: 2px;
        }
      }
    }
  }

  &#layui-dropdown-ue {
    >.layui-dropdown {
      position: fixed;
    }
  }

  * {
    box-sizing: unset;
  }

}